/**
 * Apr 14, 2010
 */
package org.tomale.id.power.customers.inquiry.ui;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

/**
 * @author ferd
 *
 */
public class AdvancedSearchDialog extends Dialog {

	Text _acct;
	Text _name;
	Text _meter;
	Text _meterSerial;
	Text _pole;
	Text _lc;
	Text _address;
	
	public AdvancedSearchDialog(Shell parentShell) {
		super(parentShell);
	}
	
	@Override
	protected void configureShell(Shell newShell) {
		super.configureShell(newShell);
		newShell.setText("Advanced Search");
	}

	@Override
	protected Control createDialogArea(Composite parent) {
		Composite comp = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		layout.numColumns = 2;
		comp.setLayout(layout);
		comp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,
				true,true));
		
		Label l;
		
		// account
		l = new Label(comp, SWT.NONE);
		l.setText("Account");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_acct = new Text(comp, SWT.BORDER);
		_acct.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// name
		l = new Label(comp, SWT.NONE);
		l.setText("Name");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_name = new Text(comp, SWT.BORDER);
		_name.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// address
		l = new Label(comp, SWT.NONE);
		l.setText("Address");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_address = new Text(comp, SWT.BORDER);
		_address.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// meter
		l = new Label(comp, SWT.NONE);
		l.setText("Meter");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_meter = new Text(comp, SWT.BORDER);
		_meter.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		// meter serial
		l = new Label(comp, SWT.NONE);
		l.setText("Meter Serial");
		l.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,
				false,false));
		
		_meterSerial = new Text(comp, SWT.BORDER);
		_meterSerial.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,
				true,false));
		
		return comp;
	}

	@Override
	protected void okPressed() {
		if(isValid()){
			super.okPressed();
		}
	}

	private boolean isValid(){
		return true;
	}
}
